package com.ucvisitorsapp.dao;

import com.ucvisitorsapp.dto.Building;

import android.database.sqlite.SQLiteDatabase;

public interface IBuildingSQLite {

	/**
	 * open SQL database
	 * @return the databse
	 */
	public abstract SQLiteDatabase openOrCreateDatabase();
	
	/**
	 * add row to database
	 * 
	 * @param building a building object containing information about the building
	 * @param db the database to write to
	 * @throws Exception throw exception upon error
	 */
	public abstract void addRow(Building building, SQLiteDatabase db) throws Exception;
	
	/**
	 * get a row from the database
	 * 
	 * @param db the database to retrieve the row from
	 * @param index the index of the row to be retrieved
	 * @return returns a building object containing the location and name of the building
	 * @throws Exception throw exception upon error
	 */
	public abstract Building getRow(int index, SQLiteDatabase db) throws Exception;
}
